﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/main/AdminBase.Master" AutoEventWireup="true" CodeBehind="list_block.aspx.cs" Inherits="Com.Ompchina.Web.admin.cms.list_block" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Model.Cms" %>
<%@ Import Namespace="Com.Ompchina.Lib.Text" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_header" runat="server">
<script type="text/javascript">
    $(function() {
        Init.tableList(".list");
        Init.deleleAction();
    })
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_pagename" runat="server">
内容管理 &gt; 广告位列表
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cph_pagelink" runat="server">
<li><a href="add_block.aspx?action=add<%= base.GetQueryString() %>">添加广告位</a></li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cph_main" runat="server">
<%
    if (PageAction.Equals("list"))
    {
%>
<form runat="server" id="frm_listBlock">
<table class="table list" cellpadding="0" cellspacing="0">
    <tr>
        <th class="w100">搜索条件：</th>
    	<td class="item">
    	    区块位置：<CustomUI:SubTermDDL runat="server" ID="ddlTerm"  ParentTermID="-1" ParentTermLabel="block" ShowTips="true"></CustomUI:SubTermDDL>&nbsp;&nbsp;
    	    区块类型：<CustomUI:BlockType runat="server" ID="ddlType"></CustomUI:BlockType>&nbsp;&nbsp;
    	    上线状态：<CustomUI:YesOrNo runat="server" ID="ddlOnline"></CustomUI:YesOrNo>&nbsp;&nbsp;
            <asp:Button ID="btnSearch" runat="server" Text="过滤" onclick="btnSearch_Click" />
    	</td>
    </tr>
</table>
</form>
<br /><br />
<table class="table list" cellpadding="0" cellspacing="0">
    <tr>
        <th>编号</th>
	    <th>类别</th>
	    <th>类型</th>
	    <th>尺寸</th>
	    <th>名称</th>
	    <th>排序</th>
        <th>上线</th>
        <th>发布时间</th>
        <th class="center w200">操作</th>
    </tr>
    <%
    int recordcount = 0, pagesize = 20;
    IList<BlockInfo> list = this._GetBlock(pagesize, out recordcount);
    if (list != null && list.Count > 0)
    {
        int i = 1; string css = string.Empty;
        foreach (BlockInfo info in list)
        {
            css = i++ % 2 == 1 ? "item" : "aitem";
                %>
                <tr class="<%= css %>">
                    <td><%= info.BlockID%></td>
                    <td><a href="list_block.aspx?action=list&termid=<%= info.BlockCategory.TermID %>"><%= Server.HtmlDecode(info.BlockCategory.TermName)%></a></td>
                    <td><a href="list_block.aspx?action=list&type=<%= info.BlockType %>"><%= this.ConvertType(info.BlockType)%></a></td>
                    <td><%= info.BlockSize%></td>
                    <td><%= Server.HtmlDecode(info.BlockName)%></td>
                    <td><%= info.Rank%></td>
                    <td><%= info.IsOnline.Equals("y") ? "是" : "否"%></td>
                    <td><%= info.AddTime%></td>
                    <td class="center w100">
                        <a href="add_block.aspx?action=update&id=<%= info.BlockID + base.GetQueryString() %>">修改</a>&nbsp;
                        <a href="list_block.aspx?action=delete&id=<%= info.BlockID %>" class="delete">删除</a>
                    </td>
                </tr>
                <%
    }
    }
    %>
    <tr>
        <th colspan="9" class="pager">
            <%
    Pager.ResponsePager(Response, "list_block.aspx"
        , "action=list" + base.GetQueryString()
        , true, true, true, true, PageIndex, pagesize, recordcount, 10); %>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;记录总数：<%= recordcount%>，每页显示<%= pagesize%>条记录，当前第页<%= PageIndex%>
       </th>
    </tr>
</table>
<%} %>
</asp:Content>
